<?php

class Application_Model_AclLibrary extends Zend_Acl
{
    public function __construct(){
        try{
            $this->add(new Zend_Acl_Resource('default:Authentication'));
            $this->add(new Zend_Acl_Resource('default:cart'));
            $this->add(new Zend_Acl_Resource('default:index'));
            $this->add(new Zend_Acl_Resource('default:news'));
            $this->add(new Zend_Acl_Resource('default:order'));
            $this->add(new Zend_Acl_Resource('default:product'));
            $this->add(new Zend_Acl_Resource('default:user'));
            $this->add(new Zend_Acl_Resource('default:error'));
            
            $this->add(new Zend_Acl_Resource('admin:index'));
            $this->add(new Zend_Acl_Resource('admin:product'));
            $this->add(new Zend_Acl_Resource('admin:error'));
            $this->add(new Zend_Acl_Resource('admin:auth'));
            $this->add(new Zend_Acl_Resource('admin:news'));
            $this->add(new Zend_Acl_Resource('admin:user'));
            $this->add(new Zend_Acl_Resource('admin:order'));
            
            $this->addRole(new Zend_Acl_Role('member'));
            $this->addRole(new Zend_Acl_Role('admin'), 'member');
            
            $this->allow('admin', null, null);
            $this->allow('member', 'default:Authentication', null);
            $this->allow('member', 'default:cart', null);
            $this->allow('member', 'default:index', null);
            $this->allow('member', 'default:news', null);
            $this->allow('member', 'default:order', null);
            $this->allow('member' ,'default:product', null);
            $this->allow('member', 'default:user', null);
            
        }
        catch (Zend_Exception $ex){
            echo $ex;
        }
        
        
    }

}

